﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BLL.Model.Repositories;

namespace BLL.Model.Voucher
{
    public abstract class Record
    {
        protected Record(IRecordRepository recordRepository)
        {
            RecordRepository = recordRepository;
        }
        //TODO: Record needs to be saved directly, need IRecordRepository insatance to do database operation
        protected IRecordRepository RecordRepository;

        public int VoucherSerialNo;
        public virtual string VoucherTypeKey { get; set; }
        public abstract string LedgerType { get; }

        public virtual string VoucherNo { get; set; }
        public string ProjectName;
        public string HeadName;

        public DateTime Date;
        public string Narration;

        public string LinkedVoucherNo;
        public string Tag;

        public double Balance
        {
            get { return Debit - Credit; }
        }

        public virtual double Debit { get; set; }
        public virtual double Credit { get; set; }

        public abstract bool Save();
    }
}
